home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / m2posx10.zoo / m2posix.10 / include / portab.m2h < prev    next >
Encoding:
Text File  |  1993-12-24  |  16.3 KB  |  569 lines

  1. /*****************************************************************************
  2.  * CONFIGURATION SECTION
  3.  * If one of the following options is not available with the selected
  4.  * compiler, the corresponding macro is ignored.
  5.  * If one of the options is not selectable within the source text, but may be
  6.  * selected global, e.g. HM2: ``$i/$w'' --> __LONG_WHOLE__, the global
  7.  * setting and the macro have to correspond!
  8.  * Otherwise the options are set automatically corresponding to the following
  9.  * macros together with other default switches by the macros __DEF_SWITCHES__
  10.  * and __IMP_SWITCHES__ (see definitions at the end of this file).
  11.  *****************************************************************************/
  12.  
  13. /* function results on stack (#if 1) or in register D0/D1 (#if 0) */
  14. #if 0 /* HM2 */
  15. #define __RES_ON_STACK__
  16. #endif
  17.  
  18. /* CARDINAL/INTEGER are compatible with LONGCARD/INT (#if 1) or
  19.    SHORTCARD/INT (#if 0) */
  20. #if 1 /* HM2, MM2 */
  21. #define __LONG_WHOLE__
  22. #endif
  23.  
  24. /* REAL is compatible with LONGREAL (#if 1) or SHORTREAL (#if 0) */
  25. #if 0 /* HM2 */
  26. #define __LONG_REAL__
  27. #endif
  28.  
  29. /* Use register vars if __REG__ (#if 1) or not (#if 0) */
  30. #if 1 /* HM2, MM2 */
  31. #define __REG_VARS__
  32. #endif
  33.  
  34. /****************************************************************************
  35.  * one of the following macros specifying the compiler must be defined (with
  36.  * commandline option -D<macro>):
  37.  *
  38.  * LPRM2   : LPR-Modula, Version 1.4
  39.  * SPCM2   : SPC-Modula, Version 2.0 (treated like LPRM2)
  40.  * HM2     : Haenisch-Modula, Version >= 5.10, 13.4.93
  41.  * MM2     : Megamax-Modula, Version 4.2
  42.  * TDIM2   : TDI-Modula, Version 3.01
  43.  *****************************************************************************/
  44.  
  45.  
  46. #if !(   (defined LPRM2)\
  47.       || (defined SPCM2)\
  48.       || (defined MM2)\
  49.       || (defined HM2)\
  50.       || (defined TDIM2)\
  51.      )
  52. #  error *** compiler not (yet) supported
  53. #endif
  54.  
  55.  
  56.  
  57.  
  58. #if (defined LPRM2) || (defined SPCM2) || (defined MM2)   || (defined TDIM2) \
  59.  || (defined HM2)   || (defined FTLM2)
  60. #  define __GEMDOS__
  61. #endif
  62.  
  63. #if (defined TSM2_1) || (defined TSM2_2) || (defined TSM2_3)
  64. #  define TSM2
  65. #endif
  66.  
  67. #if (defined FSTM2) || (defined TSM2) || (defined LM2)
  68. #  define __PCDOS__
  69. #endif
  70.  
  71. #if 0
  72. #  define __UNIX__
  73. #endif
  74.  
  75. #if 0 /* sad, but true... */
  76. #  define ISOM2
  77. #endif
  78.  
  79.  
  80.  
  81. /* Within the declaration of a procedure, parameters may be of the procedure
  82.  * type itself (ISO), i.e. the procedure type may be used before fully
  83.  * declared.
  84.  */
  85. #define ISO_recursive_proc_decl \
  86. ((defined ISOM2) || (defined MM2))
  87.  
  88.  
  89. /* Values of equal procedure types may be tested for equality (ISO).
  90.  */
  91. #define ISO_proc_compare \
  92. ((defined ISOM2) || (defined MM2) || (defined HM2))
  93.  
  94.  
  95. /* Values of equal opaque types may be tested for equality (ISO).
  96.  */
  97. #define ISO_opaque_compare \
  98. ((defined ISOM2) || (defined MM2) || (defined HM2) || (defined LPRM2) || \
  99. (defined SPCM2))
  100.  
  101.  
  102. /* Opaque types may be declared as an imported type in the corresponding
  103.  * implementation module, i.e. they don't have to be fully specified (ISO).
  104.  */
  105. #define ISO_opaque_far_imp \
  106. ((defined ISOM2) || (defined LPRM2) || (defined SPCM2))
  107.  
  108.  
  109. /* Procedure constants are available (ISO).
  110.  */
  111. #define ISO_proc_const \
  112. ((defined ISOM2) || (defined FTLM2) || (defined TSM2))
  113.  
  114.  
  115. /* Array and record constructors are available (ISO).
  116.  */
  117. #define ISO_value_constructor \
  118. ((defined ISOM2) || (defined MM2)) /* HM2 not (yet) complete */
  119.  
  120.  
  121. /* VAL is universal converting function (ISO), e.g. VAL(REAL,<cardexpr>)
  122.  * is equivalent to FLOAT(<cardexpr>).
  123.  */
  124. #define ISO_val \
  125. ((defined ISOM2) || (defined MM2))
  126.  
  127.  
  128. /* Identifiers may contain underscores (underlines?) at any position (ISO).
  129.  */
  130. #define ISO_underscore \
  131. ((defined ISOM2) || (defined MM2) || (defined HM2))
  132.  
  133.  
  134. /* Type PACKEDSET for sets of bits is available (ISO).
  135.  */
  136. #define ISO_packedset \
  137. (defined ISOM2)
  138.  
  139.  
  140. /* ISO-procedures for arithmetic on pointers are available (ISO).
  141.  */
  142. #define ISO_ptr_arith \
  143. (defined ISOM2)
  144.  
  145.  
  146. /* Functions may return arrays and records (ISO).
  147.  */
  148. #define ISO_struct_return \
  149. ((defined ISOM2) || (defined MM2) || (defined HM2) || (defined FTLM2))
  150.  
  151.  
  152. /* SET OF CHAR may be defined (ISO).
  153.  */
  154. #define ISO_char_set \
  155. ((defined ISOM2) || (defined MM2) || (defined HM2) || (defined TDIM2) || \
  156. (defined FTLM2))
  157.  
  158.  
  159. /* Type SYSTEM.LOC is available (ISO).
  160.  */
  161. #define ISO_loc \
  162. ((defined ISOM2) || (defined (MM2))
  163.  
  164.  
  165. /* Types COMPLEX and LONGCOMPLEX are available (ISO)
  166.  */
  167. #define ISO_complex 0
  168.  
  169.  
  170. /* Element 0 is most significant bit (only sets with no more than 32 elements).
  171.  */
  172. #define reverse_set \
  173. (defined FTLM2)
  174.  
  175.  
  176. /* Sets may have 32 elements.
  177.  */
  178. #define long_set \
  179. ((defined ISOM2) || (defined HM2)   || (defined SPCM2) || (defined MM2) || \
  180. (defined TDIM2) || (defined FTLM2))
  181.  
  182.  
  183. /* No colon necessary with tagless variants (PIM2).
  184.  */
  185. #define no_empty_tag_colon 0
  186.  
  187.  
  188. /* Only subranges are valid index types.
  189.  */
  190. #define only_subrange_index \
  191. ((defined LPRM2) || (defined SPCM2))
  192.  
  193.  
  194. /* Standard procedures MIN and MAX are not available.
  195.  */
  196. #define no_MIN_MAX 0
  197.  
  198.  
  199. /* Parameter type REF is available.
  200.  */
  201. #define has_REF \
  202. (defined MM2)
  203.  
  204.  
  205. /* Exportlist in definition module is necessary (PIM2).
  206.  */
  207. #define export 0
  208.  
  209.  
  210. /* Problems with reexported identifiers.
  211.  */
  212. #define no_reexport \
  213. (defined FTLM2)
  214.  
  215.  
  216. #define odd_arrays \
  217. ((defined MM2) || (defined TDIM2))
  218.  
  219.  
  220. #define align_byte_after_odd 0
  221.  
  222.  
  223.  
  224. /* Only parameters of type ARRAY OF CHAR are concerned */
  225. #if (defined TDIM2)
  226. #  define REF VAR
  227. #elif !has_REF
  228. #  define REF
  229. #endif
  230.  
  231. #if !ISO_packedset
  232. #define PACKEDSET SET
  233. #endif
  234.  
  235.  
  236.  
  237. /* If there is a special notation for LONGCARD/INT-constants */
  238.  
  239. #if (defined LPRM2) || (defined SPCM2)
  240. #  define LC(_NUM) _NUM ## D
  241. #  define LIC(_NUM) _NUM ## D
  242. #elif (defined TDIM2)
  243. #  define LC(_NUM) LONGCARD(_NUM)
  244. #  define LIC(_NUM) LONGINT(_NUM)
  245. #else
  246. #  define LC(_NUM) _NUM
  247. #  define LIC(_NUM) _NUM
  248. #endif
  249.  
  250.  
  251. /* If there is a special notation for LONGREAL-constants */
  252.  
  253. #if (defined LPRM2) || (defined SPCM2)
  254. #  define LRC(_MANT,_EXP) _MANT ## D ## _EXP
  255. #elif (defined TDIM2)
  256. /* not for CONST-declarations, only single precision */
  257. #  define LRC(_MANT,_EXP) LONG(_MANT ## E ## _EXP)
  258. #else
  259. #  define LRC(_MANT,_EXP) _MANT ## E ## _EXP
  260. #endif
  261.  
  262.  
  263. #if no_empty_tag_colon
  264. #  define TAG_COLON
  265. #else
  266. #  define TAG_COLON :
  267. #endif
  268.  
  269.  
  270. /* If VAL has to be imported from SYSTEM */
  271.  
  272. #if (defined LPRM2) || (defined SPCM2)
  273. #  define VAL_INTRINSIC FROM SYSTEM IMPORT VAL;
  274. #else
  275. #  define VAL_INTRINSIC
  276. #endif
  277.  
  278.  
  279. #if (defined FTLM2) || (defined TDIM2)
  280. /* 32 bit --> 16 bit does not work with FTLM2 version 1.18 ! */
  281. #  define VAL(_TYPE,_EXPR) _TYPE(_EXPR)
  282. #endif
  283.  
  284.  
  285. /* Emulation of ISO-function CAST */
  286.  
  287. #if (defined ISOM2) || (defined MM2) || (defined HM2)
  288. #  define CAST_IMPORT FROM SYSTEM IMPORT CAST;
  289. #elif (defined LPRM2) || (defined SPCM2)
  290. #  define CAST_IMPORT
  291. #  define CAST(_TYPE,_EXPR) VAL(_TYPE,_EXPR)
  292. #else
  293. #  define CAST_IMPORT
  294. #  define CAST(_TYPE,_EXPR) _TYPE(_EXPR)
  295. #endif
  296.  
  297.  
  298.  
  299. /* Emulation of ISO-function INT */
  300.  
  301. #if (defined FTLM2)
  302. #  define INT(_EXPR) SHORT(LONGINT(_EXPR))
  303. #elif !((defined ISOM2) || (defined HM2))
  304. #  define INT(_EXPR) VAL(INTEGER,_EXPR)
  305. #endif
  306.  
  307.  
  308. /* If NEW and DISPOSE are not available */
  309.  
  310. #if (defined LPRM2)
  311. /* #  define Storage Heap */
  312. /* #  define ALLOCATE Allocate */
  313. /* #  define DEALLOCATE Deallocate */
  314. #  define NEW(_PTR) ALLOCATE(_PTR,SIZE(_PTR ## ^))
  315. #  define DISPOSE(_PTR) DEALLOCATE(_PTR,SIZE(_PTR ## ^))
  316. #elif (defined SPCM2)
  317. #  define NEW(_PTR) ALLOCATE(_PTR,SIZE(_PTR ## ^))
  318. /* #  define DISPOSE(_PTR) DEALLOCATE(_PTR) only with original 'Storage' */
  319. #  define DISPOSE(_PTR) DEALLOCATE(_PTR,SIZE(_PTR ## ^))
  320. #endif
  321.  
  322.  
  323. /* Arithmetic on pointers */
  324.  
  325. #if ISO_ptr_arith
  326. #  define PTR_ARITH_IMPORT FROM SYSTEM IMPORT ADDADR,SUBADR,DIFADR,MAKEADR;
  327. #elif (defined LPRM2) || (defined SPCM2)
  328. #  define PTR_ARITH_IMPORT
  329.  
  330. #  define ADDADR(_PTR,_ADD) (VAL(ADDRESS,_PTR)+VAL(ADDRESS,_ADD))
  331. #  define SUBADR(_PTR,_SUB) (VAL(ADDRESS,_PTR)-VAL(ADDRESS,_SUB))
  332. #  define DIFADR(_PTR1,_PTR2) (VAL(LONGINT,_PTR1)-VAL(LONGINT,_PTR2))
  333. #  define MAKEADR(_EXPR) VAL(ADDRESS,_EXPR)
  334. #elif (defined HM2)
  335. #  define PTR_ARITH_IMPORT
  336.  
  337. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+VAL(LONGCARD,_ADD))
  338. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-VAL(LONGCARD,_SUB))
  339. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  340. #  define MAKEADR(_EXPR) VAL(ADDRESS,_EXPR)
  341. #elif (defined MM2)
  342. #  define PTR_ARITH_IMPORT
  343.  
  344. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+VAL(LONGCARD,_ADD))
  345. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-VAL(LONGCARD,_SUB))
  346. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  347. #  define MAKEADR(_EXPR) ADDRESS(VAL(LONGCARD,_EXPR))
  348. #elif (defined FTLM2)
  349. #  define PTR_ARITH_IMPORT
  350.  
  351. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+LONGCARD(_ADD))
  352. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-LONGCARD(_SUB))
  353. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  354. #  define MAKEADR(_EXPR) ADDRESS(_EXPR)
  355. #elif (defined TDIM2)
  356. #  define PTR_ARITH_IMPORT
  357.  
  358. #  define ADDADR(_PTR,_ADD) (ADDRESS(_PTR)+ADDRESS(_ADD))
  359. #  define SUBADR(_PTR,_SUB) (ADDRESS(_PTR)-ADDRESS(_SUB))
  360. #  define DIFADR(_PTR1,_PTR2) (LONGINT(_PTR1)-LONGINT(_PTR2))
  361. #  define MAKEADR(_EXPR) ADDRESS(_EXPR)
  362. #endif
  363.  
  364.  
  365. /* Imports for os-inline-calls */
  366.  
  367. #if (defined LPRM2) || (defined SPCM2)
  368. #  define OSCALL_IMPORT FROM SYSTEM IMPORT WORD, INLINE, SETREG, REG;
  369. #  define CODE INLINE
  370. #elif (defined MM2)
  371. #  define OSCALL_IMPORT FROM SYSTEM IMPORT CALLSYS, CODE, LOAD, STORE, ASSEMBLER;
  372. #elif (defined HM2)
  373. #  define OSCALL_IMPORT FROM SYSTEM IMPORT CODE, LOAD, STORE;
  374. #elif (defined TDIM2)
  375. #  define OSCALL_IMPORT FROM SYSTEM IMPORT PUSH, CODE, SETREG, REGISTER;
  376. #elif (defined FTLM2)
  377. #  define OSCALL_IMPORT FROM SYSTEM IMPORT CODE, SETREG, GETREG;
  378. #elif (defined TSM2_1)
  379. #  define OSCALL_IMPORT FROM SYSTEM IMPORT Registers, Seg, Ofs; \
  380.                         FROM AsmLib IMPORT Dos;
  381. #elif (defined LM2)
  382. #  define OSCALL_IMPORT FROM SYSTEM IMPORT DOSCALL;
  383. #endif
  384. #define INLINE_CODE_IMPORT OSCALL_IMPORT
  385.  
  386.  
  387. /* Read/write from/to cpu registers
  388.  * _VAR : only (UN)SIGNEDWORD, (UN)SIGNEDLONG or ADDRESS, and simple,
  389.  *        local variable!
  390.  */
  391.  
  392. #if (defined LPRM2) || (defined SPCM2)
  393. #  define REGISTER_IMPORT FROM SYSTEM IMPORT REG, SETREG;
  394.  
  395. #  define SETREG(_REG,_EXPR) SETREG(_REG,VAL(LONGCARD,_EXPR))
  396. #  define GETINTREG(_REG,_VAR) _VAR:=VAL(INTEGER,REG(_REG))
  397. #  define GETSWREG(_REG,_VAR) _VAR:=VAL(INTEGER,REG(_REG))
  398. #  define GETCARDREG(_REG,_VAR) _VAR:=VAL(CARDINAL,REG(_REG))
  399. #  define GETUWREG(_REG,_VAR) _VAR:=VAL(CARDINAL,REG(_REG))
  400. #  define GETLREG(_REG,_VAR) _VAR:=REG(_REG)
  401. #  define GETREGADR(_REG,_VAR) _VAR:=VAL(ADDRESS,REG(_REG))
  402. #elif (defined MM2) || (defined HM2)
  403. #  define REGISTER_IMPORT FROM SYSTEM IMPORT LOAD, STORE;
  404.  
  405. #  define SETREG(_REG,_EXPR) LOAD(_EXPR,_REG)
  406. #  define GETINTREG(_REG,_VAR) STORE(_REG,_VAR)
  407. #  define GETSWREG(_REG,_VAR) STORE(_REG,_VAR)
  408. #  define GETCARDREG(_REG,_VAR) STORE(_REG,_VAR)
  409. #  define GETUWREG(_REG,_VAR) STORE(_REG,_VAR)
  410. #  define GETLREG(_REG,_VAR) STORE(_REG,_VAR)
  411. #  define GETREGADR(_REG,_VAR) STORE(_REG,_VAR)
  412. #elif (defined TDIM2)
  413. #  define REGISTER_IMPORT FROM SYSTEM IMPORT REGISTER, SETREG;
  414.  
  415. #  define SETREG(_REG,_EXPR) SETREG(_REG,_EXPR)
  416. #  define GETINTREG(_REG,_VAR) _VAR:=INTEGER(REGISTER(_REG))
  417. #  define GETSWREG(_REG,_VAR) _VAR:=INTEGER(REGISTER(_REG))
  418. #  define GETCARDREG(_REG,_VAR) _VAR:=CARDINAL(REGISTER(_REG))
  419. #  define GETUWREG(_REG,_VAR) _VAR:=CARDINAL(REGISTER(_REG))
  420. #  define GETLREG(_REG,_VAR) _VAR:=LONGCARD(REGISTER(_REG))
  421. #  define GETREGADR(_REG,_VAR) _VAR:=REGISTER(_REG)
  422. #elif (defined FTLM2)
  423. #  define REGISTER_IMPORT FROM SYSTEM IMPORT SETREG, GETREG;
  424.  
  425. #  define SETREG(_REG,_EXPR) SETREG(_REG,LONGCARD(_EXPR))
  426. /* GETREG works only with 16-bit-vars in version 1.18 !! */
  427. #  define GETINTREG(_REG,_VAR) GETREG(_REG,_VAR)
  428. #  define GETSWREG(_REG,_VAR) GETREG(_REG,_VAR)
  429. #  define GETCARDREG(_REG,_VAR) GETREG(_REG,_VAR)
  430. #  define GETUWREG(_REG,_VAR) GETREG(_REG,_VAR)
  431. #  define GETLREG(_REG,_VAR) GETREG(_REG,_VAR)
  432. #  define GETREGADR(_REG,_VAR) GETREG(_REG,_VAR)
  433. #endif
  434.  
  435.  
  436.  
  437. /* Various compiler options */
  438.  
  439. #if (defined MM2)
  440. /* B-: Remove module body during optimized linking if no procedures needed
  441.  * D-: Don't produce debug code
  442.  * E-: Don't produce procedure trace
  443.  * K+: Assignment <short> := <long> is possible
  444.  * L+: Produce procedure frames
  445.  * M-: Don't produce procedure names
  446.  * R-: Don't produce range checks
  447.  * S-: Don't produce stack checks
  448.  * T+: Enumerations in ascending order
  449.  * U+: Sets with no more than 32 elements in BITSET format
  450.  * W-: No warnings with REF-parameters
  451.  *
  452.  * I+/-: CARDINAL/INTEGER same as LONGCARD/LONGINT or SHORTCARD/SHORTINT
  453.  * Z+/-: Function results in register or on stack
  454.  */
  455. #  ifdef __RES_ON_STACK__
  456. #    ifdef __LONG_WHOLE__
  457. #      define __DEF_SWITCHES__ (*$I+,Z-*)
  458. #      define __IMP_SWITCHES__ (*$B-,D-,E-,K+,M-,R-,S-,T+,U+,W-,I+,Z-*)
  459. #    else
  460. #      define __DEF_SWITCHES__ (*$I-,Z-*)
  461. #      define __IMP_SWITCHES__ (*$B-,D-,E-,K+,M-,R-,S-,T+,U+,W-,I-,Z-*)
  462. #    endif
  463. #  else
  464. #    ifdef __LONG_WHOLE__
  465. #      define __DEF_SWITCHES__ (*$I+,Z+*)
  466. #      define __IMP_SWITCHES__ (*$B-,D-,E-,K+,M-,R-,S-,T+,U+,W-,I+,Z+*)
  467. #    else
  468. #      define __DEF_SWITCHES__ (*$I-,Z+*)
  469. #      define __IMP_SWITCHES__ (*$B-,D-,E-,K+,M-,R-,S-,T+,U+,W-,I-,Z+*)
  470. #    endif
  471. #  endif
  472. #  define __PROCFRAME_OFF__ (*$L-*)
  473. #  define __PROCFRAME_ON__ (*$L+*)
  474. #  define __DRIVER__ (*$B+*)
  475.  
  476. #ifdef __REG_VARS__
  477. #  define __REG__ (*$Reg*)
  478. #else
  479. #  define __REG__
  480. #endif
  481.  
  482. #  define __STACKCHECK_ON__ (*$S+*)
  483. #  define __STACKCHECK_OFF__ (*$S-*)
  484. #  define __RANGECHECK_ON__ (*$R+*)
  485. #  define __RANGECHECK_OFF__ (*$R-*)
  486. #  define __DEBUG_ON__ (*$D+,E+,M+*)
  487. #  define __DEBUG_OFF__ (*$D-,E-,M-*)
  488.  
  489. #elif (defined HM2)
  490. /* B-:
  491.  * C-: Don't produce range checks for CARDINAL-operations
  492.  * D-: Don't produce debug code
  493.  * E-: Don't produce entry code for local procedures
  494.  * G-: Strings don't need to be terminated by 0C
  495.  * H-: Produce warnings if using HM2-specific constructs
  496.  * I-: Don't initialize local vars with -1
  497.  * K-: Called procedure removes it's arguments
  498.  * L-: Don't use 4 bytes as the minimal storage for enumerations
  499.  * M-: Remove module body during optimized linking if no procedures needed
  500.  * N-: Don't produce range checks for REAL-operations
  501.  * P-: Produce procedure frames
  502.  * Q-: Warnings enabled
  503.  * S-: Don't produce stack checks
  504.  * T-: Don't produce index and range checks
  505.  * V-: Don't produce range checks on INTEGER/aritmetic operations
  506.  * W-: Don't use 2 bytes as the minimal storage for enumerations
  507.  * X-: Don't make static checks (RETURN, CASE)
  508.  * Y-: Don't produce runtime checks (RETURN, CASE)
  509.  */
  510. #  define __DEF_SWITCHES__
  511. #  define __IMP_SWITCHES__ (*$B-,$C-,$D-,$E-,$G-,$H-,$I-,$K-,$L-,$M-,$N-,$Q-,$S-,$T-,$V-,$W-,$X-,$Y-*)
  512. #  define __PROCFRAME_OFF__ (*$P+*)
  513. #  define __PROCFRAME_ON__ (*$P-*)
  514. #  define __DRIVER__ (*$M+*)
  515.  
  516. #ifdef __REG_VARS__
  517. #  define __REG__ (*$R+*)
  518. #else
  519. #  define __REG__
  520. #endif
  521.  
  522. #  define __STACKCHECK_ON__ (*$S+*)
  523. #  define __STACKCHECK_OFF__ (*$S-*)
  524. #  define __RANGECHECK_ON__ (*$C+,$N+,$T+,$V+,$Y+*)
  525. #  define __RANGECHECK_OFF__ (*$C-,$N-,$T-,$V-,$Y-*)
  526. #  define __DEBUG_ON__ (*$D+,$I+*)
  527. #  define __DEBUG_OFF__ (*$D-,$I-*)
  528.  
  529. #elif (defined TDIM2)
  530. /* N-: Don't produce nil checks on dereferencing of pointers
  531.  * Q+: Within a module use BSR instead of JSR
  532.  * R-: Don't produce range checks
  533.  * S-: Don't produce stack checks
  534.  * T-: Don't produce index checks
  535.  * V-: Don't produce overflow checks
  536.  *
  537.  * P+/-: produce procedure frames
  538.  */
  539. #  define __DEF_SWITCHES__
  540. #  define __IMP_SWITCHES__ (*$N-,$Q+,$R-,$S-,$T-,$V-*)
  541. #  define __PROCFRAME_OFF__ (*$P-*)
  542. #  define __PROCFRAME_ON__ (*$P+*)
  543. #  define __DRIVER__
  544.  
  545. #  define __REG__
  546.  
  547. #  define __STACKCHECK_ON__ (*$S+*)
  548. #  define __STACKCHECK_OFF__ (*$S-*)
  549. #  define __RANGECHECK_ON__ (*$N+,$R+,$T+,$V+*)
  550. #  define __RANGECHECK_OFF__ (*$N-,$R-,$T-,$V-*)
  551. #  define __DEBUG_ON__
  552. #  define __DEBUG_OFF__
  553.  
  554. #else
  555. #  define __DEF_SWITCHES__
  556. #  define __IMP_SWITCHES__
  557. #  define __PROCFRAME_OFF__
  558. #  define __PROCFRAME_ON__
  559. #  define __DRIVER__
  560. #  define __REG__
  561. #  define __STACKCHECK_ON__
  562. #  define __STACKCHECK_OFF__
  563. #  define __RANGECHECK_ON__
  564. #  define __RANGECHECK_OFF__
  565. #  define __DEBUG_ON__
  566. #  define __DEBUG_OFF__
  567. #endif
  568.  
  569.